package com.dmm.search.web;

import com.dmm.search.pojo.ItemDoc;
import com.dmm.search.pojo.RequestParams;
import com.dmm.search.service.SearchService;
import com.hmall.common.dto.PageDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/search")
public class SearchController {

    @Autowired
    private SearchService searchService;

    @PostMapping("/list")
    public PageDTO<ItemDoc> searchItem(@RequestBody RequestParams params) {

        PageDTO<ItemDoc> pageDTO = searchService.searchItem(params);
        return pageDTO;
    }
}
